gusucode.com > 耐品图片管理系统 标准版A > 耐品图片管理系统 标准版A/Admin_Comment.asp

    <!--#include file="Admin_ChkPurview.asp"-->
<%
'===============================================================
' 著作权号:中国国家版权局著作权登记号2004SR07385
' 版权所有:深圳市耐品科技开发有限公司 www.naipin.com
' 联系电话:0755-26611119 81234844 81234845
' 联系手机:13316911914
' 联系邮箱:naipin@naipin.com
'===============================================================

Dim Action,CommentId,Comment,Rs
Action = Trim(Request.QueryString("Action"))
If Action = "Edit" Then
	CommentId = Netout.CheckNumeric(Trim(Request.QueryString("CommentId")))
	Comment = Netout.HtmlCode(Request.QueryString("Comment"),True)
	
	Set Rs = Server.CreateObject("adodb.recordset")
	Rs.Open "Select * from Nt_Remark Where Id="&CommentId,conn,1,3
	Rs("MarkDesc") = Comment
	Rs.Update
	Rs.Close
	Set Rs = Nothing
	
	Response.Redirect Request.ServerVariables("HTTP_REFERER")

End If
%>
<html>
<head>
<title>无标题文档</title>
<SCRIPT language=javascript>
function unselectall(){
    if(document.myform.chkAll.checked){
		document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}
function CheckAll(form){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.Name != "")
		e.checked = form.chkAll.checked;
	}
}
function ConfirmDel(){
	if(confirm("确定要删除选中的评论吗?本操作是无法恢复的!"))
		return true;
	else
		return false;
}
function StartEdit(rowIndex,commentId){
	var lstTable = document.getElementById("RecordList");
	var button = document.getElementById("btnEdit"+rowIndex);
	var lstRow = lstTable.rows[rowIndex];
	var description = lstRow.cells[2].innerHTML;
	lstRow.cells[2].innerHTML = '<textarea style="width: 98%" rows=4 id="comment'+commentId+'" name="comment'+commentId+'">'+description+'</textarea>';
	button.innerText = "保存";
	button.onclick = new Function("SaveEdit("+commentId+",this);");
}
function SaveEdit(commentId,author){
	var comment = document.getElementById("comment"+commentId);
	if(comment.value==""){
		alert("评论不能为空!");
		comment.focus();
		return false;		
	}
	author.href = "Admin_Comment.asp?Action=Edit&CommentId="+commentId+"&Comment="+escape(comment.value);
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
Title="管 理 评 论"
Link="<a href='?Type=Title' class='black'>组图评论</a> | <a href='?Type=Image' class='black'>单图评论</a> | <a href='Admin_Images.asp' class='black'>管理图片</a> | <a href='Admin_SiteConfig.asp' class='black'>系统配置</a>"

Dim strType
strType = Request.QueryString("Type")
strFileName = "Admin_Comment.asp?Type="&strType&"&"
currentPage = Cint(Netout.CheckStr(request.QueryString("page"),2))

With Behind
	.WriteHtmlHead
	.WriteHtmlTop Title,Link
	.MaxPerPage	 = 18
	.TopPage	 = False
	.BottomPage	 = True
	Select Case strType
		Case "Title"
			.SqlRecord	 = "select * from Nt_Remark Where TitleId>0 and exists(select * from Nt_title where titleid=Nt_Remark.titleID) order by ID desc"
		Case "Image"
			.SqlRecord	 = "select * from Nt_Remark Where ImageId>0 and exists(select * from Nt_ImgBook where id=Nt_Remark.ImageId) order by ID desc"
		Case "Diary"
			.SqlRecord	 = "select * from Nt_Remark Where DiaryId>0 and exists(select * from Nt_Diary where id=Nt_Remark.DiaryId) order by ID desc"
		Case Else
			.SqlRecord	 = "select * from Nt_Remark order by ID desc"
	End Select
	.InitText	 = "条评论"
	.strFileName = strFileName
	.ShowRecord CurrentPage

	.WriteHtmlEnd
End With
set Netout=nothing

Sub ShowContent(MaxPerPage)%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="myform" method="Post" action="Admin_CommentDel.asp?Action=Del" onSubmit="return ConfirmDel();">
    <tr>
      <td colspan="2"><table width="100%" border="0" cellspacing="1" cellpadding="2" class="border" id="RecordList">
          <tr align="center">
            <td class="tdbg1" width="6%"><b>选中</b></td>
            <td class="tdbg1" width="10%"><b>评论人</b></td>
            <td class="tdbg1" width="20%"><b>评论内容</b></td>
			<%
			Select Case strType
				Case "Title"
					Response.Write "<td class=""tdbg1"" width=""20%""><b>相关组图</b></td>"
				Case "Image"
					Response.Write "<td class=""tdbg1"" width=""20%""><b>相关图片</b></td>"
				Case "Diary"
					Response.Write "<td class=""tdbg1"" width=""20%""><b>相关文章</b></td>"
			End Select
            %>
            <td class="tdbg1" width="13%"><b>操作</b></td>
          </tr>
			<%i=0
			set ID=rs("ID"):set MarkMan=rs("MarkMan")
			Do While Not rs.Eof and i<MaxPerPage%>
			  <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#EBEBEB'">
				<td align="center"><input name="ID" type="checkbox" onClick="unselectall()" id="ID" value="<%=ID%>"></td>
				<td><%=MarkMan%></td>
				<td><%=rs("MarkDesc")%></td>
				<%
				Select Case strType
					Case "Title"
						Response.write "<td><a href='Admin_ImagesModify.asp?ID="&conn.execute("select top 1 id from nt_imgbook where titleid="&rs("titleID"))(0)&"'>点击查看组图信息</a></td>"
					Case "Image"
						Response.write "<td><a href='Admin_ImagesModify.asp?ID="&rs("ImageId")&"'>点击查看图片信息</a></td>"
					Case "Diary"
						response.write "<td><a href=diary.asp?id="&rs("diaryId")&" target='_blank'>"&Conn.Execute("Select [Title] From Nt_Diary Where ID= " &rs("DiaryID"))(0)&"</a></td>"
				End Select
				%>
				<td align="center">
				  <a id="btnEdit<%=i+1%>" href="javascript:;" onClick="javascript:StartEdit(<%=i+1%>,<%=Id%>);">修改</a> |
				  <a href="Admin_CommentDel.asp?Action=Del&ID=<%=ID%>" class="black" onclick='return ConfirmDel();'>删除</a>
				</td>
			  </tr>
			  <%i=i+1
			  rs.movenext
			loop%>
        </table>
       <br></td>
    </tr>
    <tr>
      <td width="40%" height="20">&nbsp;&nbsp;
	  <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
      选中本页所有评论</td>
      <td width="60%">
        <input name="submit" type='submit' value='删除选定的评论'>
	  </td>
    </tr>
  </form>
</table>
<%
End Sub
%>